import { ccclass, cccomponent, ccmodifier } from '../decorators';
import { BaseView } from './BaseView';
import {
    HintAlertStack,
    HintNetBusyStack,
    HintRollingTipStack,
    HintTinyLoadingStack,
    HintTipStack,
} from './hint/index';

/**
 * - 作者: DoooReyn
 * - 日期: 2023.10.31
 * - 名称: Hint
 * - 描述: 视图-提示层
 */
@ccclass()
@ccmodifier('Hint')
export class Hint extends BaseView {
    /** 普通提示堆栈 */
    @cccomponent(HintTipStack, 'Tip')
    tip: HintTipStack;

    /** 滚动提示堆栈 */
    @cccomponent(HintRollingTipStack, 'RollingTip')
    rollingTip: HintRollingTipStack;

    /** 警告提示堆栈 */
    @cccomponent(HintAlertStack, 'Alert')
    alert: HintAlertStack;

    /** 网络繁忙提示堆栈 */
    @cccomponent(HintNetBusyStack, 'NetBusy')
    netBusy: HintNetBusyStack;

    /** 小型加载提示堆栈 */
    @cccomponent(HintTinyLoadingStack, 'TinyLoading')
    tinyLoading: HintTinyLoadingStack;

    async enter() {
        await this.alert.enter();
        await this.rollingTip.enter();
        await this.tip.enter();
        await this.tinyLoading.enter();
        await this.netBusy.enter();
        this.logger.debug('进入舞台');
    }

    async exit() {
        await this.alert.exit();
        await this.tip.exit();
        await this.rollingTip.exit();
        await this.tinyLoading.exit();
        await this.netBusy.exit();
        this.logger.debug('退出舞台');
    }
}
